﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace webapi.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Title = "Home Page";
        //    Main();
            return View();
        }
        //public ActionResult Main()
        //{
        //    List<int> arr = new List<int>() { 1, 2, 3, 4, 5, 6, 7 };
        //    //var result = (from v in arr where v > 3 select v).Sum(); //大于3的合计

        //    var result = arr.Where(a => { return a > 3; }).Sum();       //大于3的合计
        //    var result1 = arr.OfType<int>();                            //筛选集合中int型的
        //    var result2 = arr.Select<int, string>(a => a.ToString());   //投影到一个新的集合IEnumerable<String>
        //    var result3 = from v in arr where v > 3 select v;
        //    List<int> arr = new List<int>() { 1, 2, 3, 4, 5, 6, 7 };
        //    var result4 = from c in db.Customers
        //                  join o in db.Orders on c.CustomerID
        //                  equals o.CustomerID into orders
        //                  select new
        //                  {
        //                      c.ContactName,
        //                      OrderCount = orders.Count()
        //                  };
        //    Console.WriteLine(result);
        //    Console.ReadKey();
        //    return View();
        //}

    }
}
